home *** CD-ROM | disk | FTP | other *** search
/ Windows 6-Pak - Disc 4 / Windows 6-Pak (InfoMagic) (Disc 4) (1999).ISO / Text-Chat-Addins / C-Script.exe / Sysfiles / Remote / xdcc.mrc < prev   
Encoding:
Text File  |  1998-04-20  |  6.9 KB  |  146 lines

  1. ;C-Script v5.0 ⌐ 1998 C-Team. All rights reserved.
  2. ;Configure at your own risk
  3. ;XDCC file
  4.  
  5. #xdcc on
  6. ctcp 1:XDCC HELP: {
  7.   .notice $nick XDCC HELP:
  8.   .notice $nick LIST: List packets in the XDCC system
  9.   .notice $nick SEARCH <wildcard>: Search for XDCC packets containing <wildcard>
  10.   .notice $nick GET <packet #>: Get XDCC packet <packet #>
  11.   .notice $nick XDCC HELP END
  12. }
  13. ctcp 1:XDCC LIST: {
  14.   %var = $readini sysfiles\xdcc\xdcc.ini stats xdcclist
  15.   inc %var
  16.   writeini sysfiles\xdcc\xdcc.ini stats xdcclist %var
  17.   %i = 1
  18.   %lines = $readini sysfiles\xdcc\xdcc.ini stats total
  19.   .notice $nick Welcome to $me $+ 's XDCC
  20.   .notice $nick You are XDCC user number %var $+ . Total number of packets available: %lines
  21.   :back
  22.   if (%i <= %lines) {
  23.     %CurInfo = $readini sysfiles\xdcc\xdcc.ini files %i
  24.     .notice $nick $chr(35) $+ %i ( $+ $nopath($gettok(%CurInfo,1,32)) $+ ) $gettok(%CurInfo,2,32) bytes. # of DL's: $readini sysfiles\xdcc\xdcc.ini stats %i Description: $gettok(%CurInfo,3-,32)
  25.     inc %i
  26.     goto back
  27.   }
  28.   write sysfiles\xdcc\xdcc.log XDCC LIST by $nick ( $+ $gettok($address($nick,5),2,33) $+ ) on $fulldate
  29. }
  30. ctcp 1:XDCC SEARCH: {
  31.   if ($3 == $null) { .notice ERROR Nothing to search for! | write sysfiles\xdcc\xdcc.log FAILED XDCC GET by $nick ( $+ $gettok($address($nick,5),2,33) $+ ) on $fulldate | halt }
  32.   %var = $readini sysfiles\xdcc\xdcc.ini stats xdccsearch
  33.   inc %var
  34.   writeini sysfiles\xdcc\xdcc.ini stats xdccsearch %var
  35.   %i = 1
  36.   %lines = $readini sysfiles\xdcc\xdcc.ini stats total
  37.   .notice $nick You are XDCC user number: %var $+ . Searching: %lines packets
  38.   :back
  39.   if (%i <= %lines) {
  40.     %CurInfo = $readini sysfiles\xdcc\xdcc.ini files %i
  41.     if ($3 isin %CurInfo) { .notice $nick $chr(35) $+ %i ( $+ $nopath($gettok(%CurInfo,1,32)) $+ ) $gettok(%CurInfo,2,32) bytes. # of DL's: $readini sysfiles\xdcc\xdcc.ini stats %i Description: $gettok(%CurInfo,3-,32) }
  42.     inc %i
  43.     goto back
  44.   }
  45.   write sysfiles\xdcc\xdcc.log XDCC SEARCH by $nick ( $+ $gettok($address($nick,5),2,33) $+ ) on $fulldate
  46. }
  47.  
  48. ctcp 1:XDCC GET: {
  49.   %var = $readini sysfiles\xdcc\xdcc.ini stats $3
  50.   if (%var == $null) { notice $nick Sorry packet $3 doesn't exist. | write sysfiles\xdcc\xdcc.log Failed XDCC GET by $nick ( $+ $gettok($address($nick,5),2,33) $+ ) on $fulldate | halt }
  51.   inc %var
  52.   writeini sysfiles\xdcc\xdcc.ini stats $3 %var
  53.   %var = $readini sysfiles\xdcc\xdcc.ini files $3
  54.   .dcc send $nick $gettok(%var,1,32)
  55.   write sysfiles\xdcc\xdcc.log XDCC GET by $nick ( $+ $gettok($address($nick,5),2,33) $+ ) on $fulldate
  56. }
  57. ctcp 1:XDCC: {
  58.   .notice $nick XDCC HELP:
  59.   .notice $nick LIST: List packets in the XDCC system
  60.   .notice $nick SEARCH <wildcard>: Search for XDCC packets containing <wildcard>
  61.   .notice $nick GET <packet #>: Get XDCC packet <packet #>
  62.   .notice $nick XDCC HELP END
  63. }
  64. #XDCC end
  65. alias xdcc {
  66.   echo -a  $+ $clr(info) $+ XDCC HELP:
  67.   echo -a  $+ $clr(info) $+ /addx: $+ $clr(info2) Add a packet to the XDCC system
  68.   echo -a  $+ $clr(info) $+ /delx #: $+ $clr(info2) Delete packet number "#" from the XDCC system
  69.   echo -a  $+ $clr(info) $+ /listx: $+ $clr(info2) List files in the XDCC system
  70.   echo -a  $+ $clr(info) $+ /offerx: $+ $clr(info2) Offer XDCC packets to the current channel
  71. }
  72. alias helpx {
  73.   echo -a  $+ $clr(info) $+ XDCC HELP:
  74.   echo -a  $+ $clr(info) $+ /addx: $+ $clr(info2) Add a packet to the XDCC system
  75.   echo -a  $+ $clr(info) $+ /delx #: $+ $clr(info2) Delete packet number "#" from the XDCC system
  76.   echo -a  $+ $clr(info) $+ /listx: $+ $clr(info2) List files in the XDCC system
  77.   echo -a  $+ $clr(info) $+ /offerx: $+ $clr(info2) Offer XDCC packets to the current channel
  78. }
  79. alias addx {
  80.   %lines = $readini sysfiles\xdcc\xdcc.ini stats total
  81.   inc %lines
  82.   set %file $$dir $mircdir
  83.   set %xdccdesc $$?="Description:"
  84.   writeini sysfiles\xdcc\xdcc.ini files %lines %file $lof(%file) %xdccdesc
  85.   writeini sysfiles\xdcc\xdcc.ini stats %lines 0
  86.   writeini sysfiles\xdcc\xdcc.ini stats total %lines
  87.   echo -a  $+ $clr(info) $+ *** " $+ $nopath(%file) $+ " added with the description, " $+ %xdccdesc $+ " Packet number: %lines
  88.   unset %file %lines %xdccdesc
  89.   if ($window(@XDCCáList:) != $null) { listx }
  90. }
  91.  
  92. alias delx {
  93.   if ($1 == $null) { set %temp $$?="Packet number to delete:" }
  94.   else { set %temp $1 }
  95.   %lines = $readini sysfiles\xdcc\xdcc.ini stats total
  96.   if (%lines == 0) { echo -a  $+ $clr(info) $+ *** ERROR: No files to delete | halt }
  97.   if (%temp !isnum) { echo -a  $+ $clr(info) $+ *** Error %temp isn't a number | halt }
  98.   if (%temp > %lines) { echo -a  $+ $clr(info) $+ *** Error no such number: %temp | halt }
  99.   if (%lines == %temp) { echo -a  $+ $clr(info) $+ *** Packet %temp removed from XDCC list | remini $mircdirxdcc\xdcc.ini files %lines | remini $mircdirxdcc\xdcc.ini stats %lines | dec %lines | writeini sysfiles\xdcc\xdcc.ini stats total %lines | unset %lines | if ($window(@XDCCáList:) != $null) { listx } | halt }
  100.   %curmove = $readini sysfiles\xdcc\xdcc.ini files %lines 
  101.   writeini sysfiles\xdcc\xdcc.ini files %temp %curmove
  102.   remini sysfiles\xdcc\xdcc.ini files %lines
  103.   %curmove = $readini sysfiles\xdcc\xdcc.ini stats %lines 
  104.   writeini sysfiles\xdcc\xdcc.ini stats %temp %curmove
  105.   remini sysfiles\xdcc\xdcc.ini stats %lines
  106.   dec %lines
  107.   writeini sysfiles\xdcc\xdcc.ini stats total %lines
  108.   echo -a  $+ $clr(info) $+ *** Packet %temp removed from XDCC list
  109.   unset %curmove %lines
  110.   if ($window(@XDCCáList:) != $null) { listx }
  111. }
  112. alias listx { 
  113.   window -c @XDCCáList:
  114.   %i = 1
  115.   %lines = $readini sysfiles\xdcc\xdcc.ini stats total
  116.   if (%lines == 0) { echo -a  $+ $clr(info) $+ *** No XDCC packets found | halt }
  117.   wincheck @XDCCáList: -l @XDCCáList: $center(550,200,@XDCCáList:) $wh(550,200,@XDCCáList:) @XDCCáList: Arial 12
  118.   .timer 1 1 window -b @XDCCáList:
  119.   :back
  120.   if (%i <= %lines) {
  121.     %CurInfo = $readini sysfiles\xdcc\xdcc.ini files %i
  122.     aline @XDCCáList:  $+ $clr(info) $+ $chr(35) %i $nopath($gettok(%CurInfo,1,32)) $+ : $+ $clr(info2) $gettok(%CurInfo,2,32) bytes  $+ $clr(info) $+ # of DL's: $+ $clr(info2) $readini sysfiles\xdcc\xdcc.ini stats %i  $+ $clr(info) $+ Description: $+ $clr(info2) $gettok(%CurInfo,3-,32)
  123.     inc %i
  124.     goto back
  125.   }
  126. }
  127. alias offerx {
  128.   %i = 1
  129.   %lines = $readini sysfiles\xdcc\xdcc.ini stats total
  130.   say Welcome to $me $+ 's XDCC
  131.   say Total number of packets available: %lines
  132.   :back
  133.   if (%i <= %lines) {
  134.     %CurInfo = $readini sysfiles\xdcc\xdcc.ini files %i
  135.     say  $+ $clr(info) $+ $chr(35) %i $nopath($gettok(%CurInfo,1,32)) $+ : $+ $clr(info2) $gettok(%CurInfo,2,32) bytes  $+ $clr(info) $+ # of DL's: $+ $clr(info2) $readini sysfiles\xdcc\xdcc.ini stats %i  $+ $clr(info) $+ Description: $+ $clr(info2) $gettok(%CurInfo,3-,32)
  136.     inc %i
  137.     goto back
  138.   }
  139.   say Type /ctcp $me XDCC GET #<number> to get the packet.
  140. }
  141. menu @XDCCáList: {
  142.   dclick listx
  143.   Delete Packet:delx $remove($gettok($strip($sline($active,1)),1,32),$chr(35))
  144.   Add Packet:addx
  145. }
  146.